# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response, get_object_or_404, redirect
from getdebt.advice.models import Event, Advice
import string

def advices(request, event_code=''):
    if not event_code:
    	adv = Advice.objects.all().order_by('sort')
    else:
    	try:
    		adv = Advice.objects.filter(event__code = event_code).order_by('sort')
    	except:
    		adv = []	
    return {'advices':adv}
